FROM node:14

# Create app directory
WORKDIR /usr/local/fuxa

RUN git clone https://gitee.com/shx0518/FUXA.git
WORKDIR /usr/local/fuxa/FUXA

# Install server
WORKDIR /usr/local/fuxa/FUXA/server
RUN npm install --registry=https://registry.npm.taobao.org

# Workaround for sqlite3 https://stackoverflow.com/questions/71894884/sqlite3-err-dlopen-failed-version-glibc-2-29-not-found
#RUN yum install -y sqlite  libsqlite3-dev  && \
#    npm config set registry https://registry.npm.taobao.org && \
#    npm install --build-from-source --sqlite=/usr/bin sqlite3

ADD . /usr/src/app/FUXA

WORKDIR /usr/local/fuxa/FUXA/server
EXPOSE 1881
CMD [ "npm", "start" ]
